# -*- coding: utf-8 -*-
"""
author:码同学 极光
date:2024/11/2
desc: 
sample: 
"""
import unittest

class TestMathOperations(unittest.TestCase):
    # 类级别的前置方法
    @classmethod
    def setUpClass(cls):
        print("Setting up the database connection")
        cls.db_connection = "Database connection established"

    # 类级别的后置方法
    @classmethod
    def tearDownClass(cls):
        print("Closing the database connection")
        cls.db_connection = None

    def setUp(self):
        # 在每个测试方法之前执行
        print("Setting up the test")

    def setUp(self):
        # 在每个测试方法之前执行
        print("Setting up the test")

    def tearDown(self):
        # 在每个测试方法之后执行
        print("Tearing down the test")

    def test_addition(self):
        self.assertEqual(1 + 1, 2)

    def test_subtraction(self):
        self.assertEqual(2 - 1, 1)

    def test_multiplication(self):
        self.assertEqual(2 * 3, 6)

if __name__ == '__main__':
    unittest.main()